import time
import redis

rc = redis.StrictRedis(host='127.0.0.1', port='6379', db=0)
ps = rc.pubsub()
ps.subscribe('Tong')  #从Tong订阅消息
for item in ps.listen():        #监听状态：有消息发布了就拿过来
    if item['type'] == 'message':
        print(item['channel'])
        print(item['data'])